﻿using AutoMapper;
using DAL.Models.DTO;

namespace DAL.Models.AutoMapperConfigManage
{
    public class UserInfoProfile:Profile
    {
        public UserInfoProfile()
        {
            // 对多个属性进行自定义映射
            CreateMap<UserInfo, UserDTO>().ReverseMap();
                //.ForMember(destinationMember: des => des.Id, memberOptions: opt => { opt.MapFrom(mapExpression: map => map.Id); })
                //.ForMember(destinationMember: des => des.Phone, memberOptions: opt => { opt.MapFrom(mapExpression: map => map.Phone); })
                //.ForMember(destinationMember: des => des.AddTime, memberOptions: opt => { opt.MapFrom(mapExpression: map => map.AddTime); })
                //.ForMember(destinationMember: des => des.ContactAddress, memberOptions: opt => { opt.MapFrom(mapExpression: map => map.ContactAddress); })
                //// ReverseMap表示双向映射
                //.ReverseMap();

        }
    }
}
